﻿@model OnlineExam.Entities.Post


<div class="editor-label">
    @Html.LabelFor(model => model.Title)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Title)
    @Html.ValidationMessageFor(model => model.Title)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Clicks)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Clicks)
    @Html.ValidationMessageFor(model => model.Clicks)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Body)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Body)
    @Html.ValidationMessageFor(model => model.Body)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Status)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Status)
    @Html.ValidationMessageFor(model => model.Status)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.CreatedAt)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.CreatedAt)
    @Html.ValidationMessageFor(model => model.CreatedAt)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.UpdatedAt)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.UpdatedAt)
    @Html.ValidationMessageFor(model => model.UpdatedAt)
</div>

<div class="editor-label">
    User
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.UserID, ((IEnumerable<OnlineExam.Entities.User>)ViewBag.PossibleUser).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Name), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.UserID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.UserID)
</div>
<div class="editor-label">
    Category
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.CategoryID, ((IEnumerable<OnlineExam.Entities.Category>)ViewBag.PossibleCategory).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Name), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.CategoryID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.CategoryID)
</div>
